<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Swagger UI</title>
  <link rel="icon" type="image/png" href="/static/doc/images/favicon-32x32.png" sizes="32x32" />
  <link rel="icon" type="image/png" href="/static/doc/images/favicon-16x16.png" sizes="16x16" />
  <link href='/static/doc/css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='/static/doc/css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='/static/doc/css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='/static/doc/css/reset.css' media='print' rel='stylesheet' type='text/css'/>
  <link href='/static/doc/css/print.css' media='print' rel='stylesheet' type='text/css'/>

  <script src='/static/doc/lib/object-assign-pollyfill.js' type='text/javascript'></script>
  <script src='/static/doc/lib/jquery-1.8.0.min.js' type='text/javascript'></script>
  <script src='/static/doc/lib/jquery.slideto.min.js' type='text/javascript'></script>
  <script src='/static/doc/lib/jquery.wiggle.min.js' type='text/javascript'></script>
  <script src='/static/doc/lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
  <script src='/static/doc/lib/handlebars-4.0.5.js' type='text/javascript'></script>
  <script src='/static/doc/lib/lodash.min.js' type='text/javascript'></script>
  <script src='/static/doc/lib/backbone-min.js' type='text/javascript'></script>
  <script src='/static/doc/swagger-ui.js' type='text/javascript'></script>
  <script src='/static/doc/lib/highlight.9.1.0.pack.js' type='text/javascript'></script>
  <script src='/static/doc/lib/highlight.9.1.0.pack_extended.js' type='text/javascript'></script>
  <script src='/static/doc/lib/jsoneditor.min.js' type='text/javascript'></script>
  <script src='/static/doc/lib/marked.js' type='text/javascript'></script>
  <script src='/static/doc/lib/swagger-oauth.js' type='text/javascript'></script>

  <!-- Some basic translations -->
  <script src='/static/doc/lang/translator.js' type='text/javascript'></script>
  <!-- <script src='/static/doc/lang/ru.js' type='text/javascript'></script> -->
  <script src='/static/doc/lang/zh-cn.js' type='text/javascript'></script>

  <script type="text/javascript">
    $(function () {
      var url = window.location.search.match(/url=([^&]+)/);
      if (url && url.length > 1) {
        url = decodeURIComponent(url[1]);
      } else {
        //url = "/static/api/demo/default.yaml";
        url = "/index.php/api/doc/preview";
      }
      hljs.configure({
        highlightSizeThreshold: 5000
      });

      // Pre load translate...
      if(window.SwaggerTranslator) {
        window.SwaggerTranslator.translate();
      }
      window.swaggerUi = new SwaggerUi({
        url: url,
        dom_id: "swagger-ui-container",
        supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
        onComplete: function(swaggerApi, swaggerUi){
          if(typeof initOAuth == "function") {
            initOAuth({
              clientId: "your-client-id",
              clientSecret: "your-client-secret-if-required",
              realm: "your-realms",
              appName: "your-app-name",
              scopeSeparator: " ",
              additionalQueryStringParams: {}
            });
          }

          if(window.SwaggerTranslator) {
            window.SwaggerTranslator.translate();
          }
        },
        onFailure: function(data) {
          log("Unable to Load SwaggerUI");
        },
        docExpansion: "none",
        jsonEditor: false,
        defaultModelRendering: 'schema',
        showRequestHeaders: false
      });

      window.swaggerUi.load();

      function log() {
        if ('console' in window) {
          console.log.apply(console, arguments);
        }
      }
    });
  </script>
  <style>
    .swagger-section .swagger-ui-wrap .model-signature .description{
      font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
      background-color: #fcf6db;
      border: 1px solid #e5e0c6;
      padding: 10px;
    }
    .swagger-section .swagger-ui-wrap .model-signature .description .strong{
      display: block;
    }
    .swagger-section .swagger-ui-wrap .model-signature .propName{
      color:#333;
    }
    .swagger-section .swagger-ui-wrap .model-signature .propType{
      color:#c10f0f;
    }

    .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre{
      line-height: 20px;
    }
  </style>
</head>

<body class="swagger-section" style="overflow-y:scroll">
<div id='header'>
  <div class="swagger-ui-wrap">
    <a id="logo" href="#">
      <img class="logo__img" alt="swagger" height="30" width="30" src="/static/doc/images/logo_small.png" />
      <span class="logo__title">PtPHP</span></a>
    <form id='api_selector'>
      <div class='input'><input value="" placeholder="" id="input_baseUrl" name="baseUrl" type="text"/></div>
      <div id='auth_container'></div>
      <div class='input'><a id="explore" class="header__btn" href="#" data-sw-translate>Explore</a></div>
    </form>
  </div>
</div>

<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
<div style="text-align: center;margin:10px;">
  <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md" target="_blank">OpenAPI-Specification</a>
</div>
<script>
  document.onkeydown = function(e){
    e = e || window.event;
    console.log(e.keyCode)
    if(e.metaKey && (e.keyCode == 83 )){
      e.preventDefault();
    }
    if(e.metaKey && (e.keyCode == 82)){
      $("#explore").click();
      e.preventDefault();
    }
  };
</script>
</body>
</html>
